/*
 * @description:
 * @Author: lal
 * @Date: 2020-05-27 11:11:43
 * @LastEditors: lal
 * @LastEditTime: 2020-05-27 11:23:59
 */

const { ipcMain, dialog } = require("electron");

ipcMain.handle("open-file-dialog", async (event, opt) => {
  let defaultOptions = {
    properties: ["openFile", "openDirectory"],
  };

  let options = Object.assign(defaultOptions, opt);
  const result = await dialog.showOpenDialog(options);
  return result;
});
